package com.example.backend.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

@Configuration
public class JdbcTemplateConfig {

    @Autowired
    private DataSource messageDataSource;

    @Autowired
    private DataSource gameMessageDataSource;

    @Bean(name = "messageJdbcTemplate")
    public JdbcTemplate messageJdbcTemplate() {
        return new JdbcTemplate(messageDataSource);
    }

    @Bean(name = "gameMessageJdbcTemplate")
    public JdbcTemplate gameMessageJdbcTemplate() {
        return new JdbcTemplate(gameMessageDataSource);
    }
}
